widget: Make sure we only run controllers on realized widgets
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 21 Sep 2015 13:09:32 +0000 (15:09 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 21 Sep 2015 13:55:33 +0000 (15:55 +0200)
The default event bubbling paths are prone to just running event controllers
even after the widget was potentially unrealized/destroyed in an event
handler callback, so bail out early if that's the case.

https://bugzilla.gnome.org/show_bug.cgi?id=755352

gtk/gtkwidget.c

index ffd6b99bbd09a24254029c0c42c5d57d443dd0ae..2ec9c04fc0eaf9bb81655fe28d4cf2ba4d93d552 100644 (file)
@@ -7309,6 +7309,9 @@ _gtk_widget_run_controllers (GtkWidget           *widget,
     {
       GList *next = l->next;
 
+      if (!WIDGET_REALIZED_FOR_EVENT (widget, event))
+        break;
+
       data = l->data;
 
       if (data->controller == NULL)